import axios from 'axios'
import React, { Component } from 'react'

export default class News extends Component {
    state = {
        news: []
    }
    render() {
        return (
            <ul>
                {
                    this.state.news.map(item => {
                        return <li>{item.title}</li>
                    })
                }
                
                
            </ul>
        )
    }

    async componentDidMount(){
        // let url = '/toutiao/api/pc/list/feed?channel_id=3189398972&min_behot_time=0&refresh_count=1&category=pc_profile_channel&_signature=_02B4Z6wo00901lqCviAAAIDC2oBEYXF1UTZaprqAAPfeOiffg.iTr45FaNzwFOogM68anmcKX-CIb3AunplKtqxaFrd7TL5j4.OiI6kADbsWjJJ5MQmJaMP4r6HCRQXJMz77gN3oBrr5fYSg9a';
        let url = 'http://127.0.0.1:8090/news?_start=10&_limit=20';

        let result = await axios(url);

        this.setState({
            news: result.data
        })
    }
}
